﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Moose.Common
{
    public class ControlMethods
    {
        public void IniCombox(System.Windows.Forms.ComboBox cb, Type type)
        {
            cb.DisplayMember = "Description";
            cb.ValueMember = "Value";
            List<Model.ObjectInfo> list = new List<Model.ObjectInfo>();

            foreach (var inst in Enum.GetValues(type))
            {
                list.Add(new Model.ObjectInfo()
                {
                    Description = Methods.GetEnumDescription(inst as System.Enum),
                    Value = inst
                });
            }
            cb.DataSource = list;
        }
    }
}
